package es.shinra.app.BBDD.Object;


import es.shinra.app.properties.Config;
import es.shinra.app.properties.iConfig;
import java.io.FileNotFoundException;
import java.text.MessageFormat;

/**
 * Queries for the database
 *
 * @author Jose Antonio Prieto
 */
public class Query{ 

	// ========== Image Querys ==========
	/** Query - IMAGE: Image Id from Id given */
	private String imageIdFromOwner;
	/** Query - IMAGE: Image Information from Email given */
	private String imageInfoFromOwner;
	/** Query - IMAGE: Image Information from Id given */
	private String imageInfoFromId;
	/** Query - IMAGE: Image Exif from Id given */
	private String imageExifFromId;
	/** Query - IMAGE: Image Exif field from Id given */
	private String imageExifFieldFromId;
	/** Query - IMAGE: Image Application properties from Id given */
	private String imageAppPropertiesFromId;
	/** Query - IMAGE: Image Application properties field from Id given */
	private String imageAppPropertiesFieldFromId;
	/** Query - IMAGE: Image Id from free tag given */
	private String imageIdFromFreeTag;
	/** Query - IMAGE: Image Id from free tag given */
	private String imageIdListFromPreDefinedTag;
	/** Query - IMAGE: Image URL from Id given */
	private String imageURLFromId;
    /** Query - IMAGE: Image Id from URL given */
	private String imageIdFromURL;
	/** Query - IMAGE: Add a basic image */
	private String addBasicImage;
	/** Query - IMAGE: Delete an image */
	private String deleteImage;
	/** Query - IMAGE: Modify an image exif field */
	private String modifyImageExif;
	/** Query - IMAGE: Modify an image properties field */
	private String modifyImageProperties;
	/** Query - IMAGE: Modify an image rank field */
	private String modifyImageRank;
	/** Query - IMAGE: Add a free tag to the image */
	private String addFreeTagToImage;
	/** Query - IMAGE: Add a pre-defined tag to the image */
	private String addPreDefinedTagToImage;
	/** Query - IMAGE: Add a free region tag to the image */
	private String addFreeRegionTagToImage;
	/** Query - IMAGE: Add a pre-defined region tag to the image */
	private String addPreDefinedRegionTagToImage;
	/** Query - IMAGE: Delete a tag to the image */
	private String deleteTagToImage;
	/** Query - IMAGE: Next image id available */
	private String nextImageId;

	// ========== Video Querys ==========

	/** Query - VIDEO: Video Id from Owner given */
	private String videoIdFromOwner;
	/** Query - VIDEO: Video Information from Owner given */
	private String videoInfoFromOwner;
	/** Query - VIDEO: Video Information from Id given */
	private String videoInfoFromId;
	/** Query - VIDEO: Video Information field from Owner given*/
	private String videoInfoFieldFromId;
	/** Query - VIDEO: Video list Id from free tag given */
	private String videoIdListFromFreeTag;
	/** Query - VIDEO: Video list Id from pre-defined tag given */
	private String videoIdListFromPreDefinedTag;
	/** Query - VIDEO: Video URL from Id given*/
	private String videoURLFromId;
    /** Query - VIDEO: Video Id from URL given*/
    private String videoIdFromURL;
	/** Query - VIDEO: Add a Video */
	private String addBasicVideo;
	/** Query - VIDEO: Delete a Video */
	private String deleteVideo;
	/** Query - VIDEO: Modify a Video field */
	private String modifyVideoField;
	/** Query - VIDEO: Modify a Video rate */
	private String modifyVideoRate;
	/** Query - VIDEO: Add a free tag to a Video */
	private String addFreeTagToVideo;
	/** Query - VIDEO: Add a pre-defined tag to a Video */
	private String addPreDefinedTagToVideo;
	/** Query - VIDEO: Delete a tag to a Video */
	private String deleteTagToVideo;
	/** Query - VIDEO: Next video id available */
	private String nextVideoId;

	// ========== Notice Querys ==========

	/** Query - NOTICE: Notice Id list from Owner given */
	private String noticeIdListFromOwner;
	/** Query - NOTICE: Notice Information lists from Owner given */
	private String noticeInfoFromOwner;
	/** Query - NOTICE: Notice Information lists from Id given */
	private String noticeInfoFromId;
	/** Query - NOTICE: Notice Id list from containing a certain word at any paragraph */
	private String noticeIdFromKeywordInAnyParagraph;
	/** Query - NOTICE: Image URL from any Notice Title containing a certain word */
	private String imURLFromAnyNoticeTitContKw;
	/** Query - NOTICE: Image URL from any Notice Paragraph containing a certain word */
	private String imURLFromAnyNoticeParContKw;
	/** Query - NOTICE: Image URL from any Notice Paragraph containing a certain word
	 * into a preceding or following paragraph */
	private String imURLFromAnyNoticeParContKwPredAnt;
	/** Query - NOTICE: Delete a notice */
	private String deleteNotice;
	/** Query - NOTICE: Next notice id available */
	private String nextNoticeId;

	// ========== User Querys ==========

	/** Query - USER: User information from Owner given */
	private String userInfoFromOwner;
	/** Query - USER: User information from Id given */
	private String userInfoFromId;
	/** Query - USER: User information field from Owner given */
	private String userInfoFieldFromOwner;
	/** Query - USER: User home directory from Owner given */
	private String userHomeDirectoryFromOwner;
	/** Query - USER: User home directory from Id given */
	private String userHomeDirectoryFromId;
	/** Query - USER: Add a user */
	private String addUser;
    /** Query - USER: Delete a user */
	private String deleteUser;
    /** Query - USER: Modify a user data field */
	private String modifyUserField;
    /** Query - USER: Modify a user name (firstName and lastName) */
	private String modifyUserName;
    /** Query - USER: Next user id available */
	private String nextUserId;


	/** Constructor */
	public Query() {
	}

	/**
	 * This function initialices the IMAGE related Query's
	 */
	public void loadQuerys() {
        iConfig aConfig = null;
        try {
            aConfig = new Config();
        } catch (FileNotFoundException ex) {
            ex.printStackTrace();
        }
        aConfig.init();

        /*imageIdFromOwner = "for $a in doc(\"images_db.xml\")/images/image[@owner=\"{0}\"]"
        + "return <id>{string($a/@id)}</id>";*/
        // ========= Image Querys  =========
        imageIdFromURL = aConfig.getQuery("imageIdFromURL");
        
		imageIdFromOwner = aConfig.getQuery("imageURLFromId");

		imageInfoFromOwner = aConfig.getQuery("imageInfoFromOwner");

		imageInfoFromId = aConfig.getQuery("imageInfoFromId");

		imageExifFromId = aConfig.getQuery("imageExifFromId");

		imageExifFieldFromId = aConfig.getQuery("imageExifFieldFromId");

		imageAppPropertiesFromId = aConfig.getQuery("imageAppPropertiesFromId");

		imageAppPropertiesFieldFromId = aConfig.getQuery("imageAppPropertiesFieldFromId");

		imageIdFromFreeTag = aConfig.getQuery("imageIdFromFreeTag");

		imageIdListFromPreDefinedTag = aConfig.getQuery("imageIdListFromPreDefinedTag");

		imageURLFromId = aConfig.getQuery("imageURLFromId");

		addBasicImage = aConfig.getQuery("addBasicImage");

		deleteImage = aConfig.getQuery("deleteImage");

		modifyImageExif = aConfig.getQuery("modifyImageExif");

		modifyImageProperties = aConfig.getQuery("modifyImageProperties");

		modifyImageRank = aConfig.getQuery("modifyImageRank");

		addFreeTagToImage = aConfig.getQuery("addFreeTagToImage");

		addPreDefinedTagToImage = aConfig.getQuery("addPreDefinedTagToImage");

		addFreeRegionTagToImage = aConfig.getQuery("addFreeRegionTagToImage");

		addPreDefinedRegionTagToImage = aConfig.getQuery("addPreDefinedRegionTagToImage");

		deleteTagToImage = aConfig.getQuery("deleteTagToImage");

		nextImageId = aConfig.getQuery("nextImageId");

		// ========= Video Querys  =========

		videoIdFromOwner = aConfig.getQuery("videoIdFromOwner");

		videoInfoFromOwner = aConfig.getQuery("videoInfoFromOwner");

		videoInfoFromId = aConfig.getQuery("videoInfoFromId");

		videoInfoFieldFromId = aConfig.getQuery("videoInfoFieldFromId");

		videoIdListFromFreeTag = aConfig.getQuery("videoIdListFromFreeTag");

		videoIdListFromPreDefinedTag = aConfig.getQuery("videoIdListFromPreDefinedTag");

		videoURLFromId = aConfig.getQuery("videoURLFromId");

        videoIdFromURL = aConfig.getQuery("videoIdFromURL");

		addBasicVideo = aConfig.getQuery("addBasicVideo");

		deleteVideo = aConfig.getQuery("deleteVideo");

		modifyVideoField = aConfig.getQuery("modifyVideoField");

		modifyVideoRate = aConfig.getQuery("modifyVideoRate");

		addFreeTagToVideo = aConfig.getQuery("addFreeTagToVideo");


		addPreDefinedTagToVideo = aConfig.getQuery("addPreDefinedTagToVideo");

		deleteTagToVideo = aConfig.getQuery("deleteTagToVideo");

		nextVideoId = aConfig.getQuery("nextVideoId");

		// ========= Notice Querys  =========

		noticeIdListFromOwner = aConfig.getQuery("noticeIdListFromOwner");

		noticeInfoFromOwner = aConfig.getQuery("noticeInfoFromOwner");

		noticeInfoFromId = aConfig.getQuery("noticeInfoFromId");

		noticeIdFromKeywordInAnyParagraph = aConfig.getQuery("noticeIdFromKeywordInAnyParagraph");

		imURLFromAnyNoticeTitContKw = aConfig.getQuery("imURLFromAnyNoticeTitContKw");

		imURLFromAnyNoticeParContKw = aConfig.getQuery("imURLFromAnyNoticeParContKw");

		imURLFromAnyNoticeParContKwPredAnt = aConfig.getQuery("imURLFromAnyNoticeParContKwPredAnt");

		deleteNotice = aConfig.getQuery("deleteNotice");

		nextNoticeId = aConfig.getQuery("nextNoticeId");
		// ========= Users Querys  =========

		userInfoFromOwner = aConfig.getQuery("userInfoFromOwner");

		userInfoFromId = aConfig.getQuery("userInfoFromId");

		userInfoFieldFromOwner = aConfig.getQuery("userInfoFieldFromOwner");

		userHomeDirectoryFromOwner = aConfig.getQuery("userHomeDirectoryFromOwner");

		userHomeDirectoryFromId = aConfig.getQuery("userHomeDirectoryFromId");

		addUser = aConfig.getQuery("addUser");

		deleteUser = aConfig.getQuery("deleteUser");

		modifyUserField = aConfig.getQuery("modifyUserField");

		modifyUserName = aConfig.getQuery("modifyUserName");

		nextUserId = aConfig.getQuery("nextUserId");
	}

	/**
	 * Getter
	 * @param owner
	 * @return the noticeIdListFromOwner
	 */
	public String getNoticeIdListFromOwner(String owner) {
		if(!owner.equals(null)){
			Object[] params = {owner};
			return new MessageFormat(noticeIdListFromOwner).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param owner
	 * @return the noticeInfoFromOwner
	 */
	public String getNoticeInfoFromOwner(String owner) {
		if(!owner.equals(null)){
			Object[] params = {owner};
			return new MessageFormat(noticeInfoFromOwner).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the noticeInfoFromId
	 */
	public String getNoticeInfoFromId(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(noticeInfoFromId).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param keyword
	 * @return the noticeIdFromKeywordInAnyParagraph
	 */
	public String getNoticeIdFromKeywordInAnyParagraph(String keyword) {
		if(!keyword.equals(null)){
			Object[] params = {keyword};
			return new MessageFormat(noticeIdFromKeywordInAnyParagraph).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param keyword
	 * @return the imURLFromAnyNoticeTitContKw
	 */
	public String getImURLFromAnyNoticeTitContKw(String keyword) {
		if(!keyword.equals(null)){
			Object[] params = {keyword};
			return new MessageFormat(imURLFromAnyNoticeTitContKw).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param keyword
	 * @return the imURLFromAnyNoticeParContKw
	 */
	public String getImURLFromAnyNoticeParContKw(String keyword) {
		if(!keyword.equals(null)){
			Object[] params = {keyword};
			return new MessageFormat(imURLFromAnyNoticeParContKw).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param keyword
	 * @return the imURLFromAnyNoticeParContKwPredAnt
	 */
	public String getImURLFromAnyNoticeParContKwPredAnt(String keyword) {
		if(!keyword.equals(null)){
			Object[] params = {keyword};
			return new MessageFormat(imURLFromAnyNoticeParContKwPredAnt).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param owner
	 * @return the userInfoFromOwner
	 */
	public String getUserInfoFromOwner(String owner) {
		if(!owner.equals(null)){
			Object[] params = {owner};
			return new MessageFormat(userInfoFromOwner).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the userInfoFromId
	 */
	public String getUserInfoFromId(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(userInfoFromId).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param owner
	 * @return the userInfoFieldFromOwner
	 */
	public String getUserInfoFieldFromOwner(String owner) {
		if(!owner.equals(null)){
			Object[] params = {owner};
			return new MessageFormat(userInfoFieldFromOwner).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param owner
	 * @return the userHomeDirectoryFromOwner
	 */
	public String getUserHomeDirectoryFromOwner(String owner) {
		if(!owner.equals(null)){
			Object[] params = {owner};
			return new MessageFormat(userHomeDirectoryFromOwner).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the userHomeDirectoryFromId
	 */
	public String getUserHomeDirectoryFromId(String id) {
		if (!id.equals(null)) {
			Object[] params = {id};
			return new MessageFormat(userHomeDirectoryFromId).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the videoURLFromId
	 */
	public String getVideoURLFromId(String id) {
		if (!id.equals(null)) {
			Object[] params = {id};
			return new MessageFormat(videoURLFromId).format(params);
		}
		return null;
	}


	/**
	 * Getter
	 * @param taxonomy
	 * @param tagname
	 * @return the videoIdListFromPreDefinedTag
	 */
	public String getVideoIdListFromPreDefinedTag(String taxonomy, String tagname) {
		if(!taxonomy.equals(null) && !tagname.equals(null)){
			Object[] params = {taxonomy,tagname};
			return new MessageFormat(videoIdListFromPreDefinedTag).format(params);
		}
		return null;
	}


	/**
	 * Getter
	 * @param tagname
	 * @return the videoIdListFromFreeTag
	 */
	public String getVideoIdListFromFreeTag(String tagname) {
		if(!tagname.equals(null)){
			Object[] params = {tagname};
			return new MessageFormat(videoIdListFromFreeTag).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the videoInfoFieldFromId
	 */
	public String getVideoInfoFieldFromId(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(videoInfoFieldFromId).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the videoInfoFromId
	 */
	public String getVideoInfoFromId(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(videoInfoFromId).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param owner
	 * @return the videoInfoFromOwner
	 */
	public String getVideoInfoFromOwner(String owner) {
		if(!owner.equals(null)){
			Object[] params = {owner};
			return new MessageFormat(videoInfoFromOwner).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param owner
	 * @return the videoIdFromOwner
	 */
	public String getVideoIdFromOwner(String owner) {
		if(!owner.equals(null)){
			Object[] params = {owner};
			return new MessageFormat(videoIdFromOwner).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param owner
	 * @return the imageIdFromOwner
	 */
	public String getImageIdFromOwner(String owner) {
		if(!owner.equals(null)){
			Object[] params = {owner};
			return new MessageFormat(imageIdFromOwner).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param owner
	 * @return the imageInfoFromOwner
	 */
	public String getImageInfoFromOwner(String owner) {
		if(!owner.equals(null)){
			Object[] params = {owner};
			return new MessageFormat(imageInfoFromOwner).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the imageInfoFromId
	 */
	public String getImageInfoFromId(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(imageInfoFromId).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the imageExifFromId
	 */
	public String getImageExifFromId(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(imageExifFromId).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the imageExifFieldFromId
	 */
	public String getImageExifFieldFromId(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(imageExifFieldFromId).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the imageAppPropertiesFromId
	 */
	public String getImageAppPropertiesFromId(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(imageAppPropertiesFromId).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the imageAppPropertiesFieldFromId
	 */
	public String getImageAppPropertiesFieldFromId(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(imageAppPropertiesFieldFromId).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param tagname
	 * @return the imageIdFromFreeTag
	 */
	public String getImageIdFromFreeTag(String tagname) {
		if(!tagname.equals(null)){
			Object[] params = {tagname};
			return new MessageFormat(imageIdFromFreeTag).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param taxonomy
	 * @param tagname
	 * @return the imageIdListFromPreDefinedTag
	 */
	public String getImageIdListFromPreDefinedTag(String taxonomy, String tagname) {
		if(!taxonomy.equals(null) && !tagname.equals(null)){
			Object[] params = {taxonomy,tagname};
			return new MessageFormat(imageIdListFromPreDefinedTag).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @return the imageURLFromId
	 */
	public String getImageURLFromId(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(imageURLFromId).format(params);
		}
		return null;
	}

	/**
	 * @return the nextImageId
	 */
	public String getNextImageId() {
        
		return nextImageId;
	}

	/**
	 * @return the nextVideoId
	 */
	public String getNextVideoId() {
		return nextVideoId;
	}

	/**
	 * @return the nextNoticeId
	 */
	public String getNextNoticeId() {
		return nextNoticeId;
	}

	/**
	 * @return the nextUserId
	 */
	public String getNextUserId() {
		return nextUserId;
	}

	/**
	 * Getter
	 * @param id
	 * @param owner
	 * @param title
	 * @return the addBasicImage
	 */
	public String getAddBasicImage(String id, String owner, String title) {
		if(!id.equals(null) && !owner.equals(null) && !title.equals(null)){
			Object[] params = {id,owner,title};
			return new MessageFormat(addBasicImage).format(params);
		}
		return null;
	}

	/**
	 *
	 * Getter.
	 * @param id
	 * @return the deleteBasicImage
	 */
	public String getDeleteBasicImage(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(deleteImage).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @param tagname
	 * @return the addFreeTagToImage
	 */
	public String getAddFreeTagToImage(String id, String tagname) {
		if(!id.equals(null) && !tagname.equals(null)){
			Object[] params = {id,tagname};
			return new MessageFormat(addFreeTagToImage).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @param taxonomy
	 * @param tagname
	 * @return the addPreDefinedTagToImage
	 */
	public String getAddPreDefinedTagToImage(String id, String taxonomy, String tagname) {
		if(!id.equals(null) && !taxonomy.equals(null) && !tagname.equals(null)){
			Object[] params = {id,taxonomy,tagname};
			return new MessageFormat(addPreDefinedTagToImage).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @param tagname
	 * @param initCoordinateX
	 * @param endCoordinateX
	 * @param initCoordinateY
	 * @param endCoordinateY
	 * @return the addFreeRegionTagToImage
	 */
	public String getAddFreeRegionTagToImage(String id, String tagname, String initCoordinateX,
			String endCoordinateX, String initCoordinateY, String endCoordinateY) {
		if(!id.equals(null) && !tagname.equals(null) && !initCoordinateX.equals(null) &&
				!endCoordinateX.equals(null) && !initCoordinateY.equals(null) && !endCoordinateY.equals(null)){
			Object[] params = {id,tagname,initCoordinateX,endCoordinateX,initCoordinateY,endCoordinateY};
			return new MessageFormat(addFreeRegionTagToImage).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @param taxonomy
	 * @param tagname
	 * @param initCoordinateX
	 * @param endCoordinateX
	 * @param initCoordinateY
	 * @param endCoordinateY
	 * @return the addPreDefinedRegionTagToImage
	 */
	public String getAddPreDefinedRegionTagToImage(String id, String taxonomy, String tagname, String initCoordinateX,
			String endCoordinateX, String initCoordinateY, String endCoordinateY) {
		if(!id.equals(null) && !taxonomy.equals(null) && !tagname.equals(null) && !initCoordinateX.equals(null) &&
				!endCoordinateX.equals(null) && !initCoordinateY.equals(null) && !endCoordinateY.equals(null)){
			Object[] params = {id,taxonomy,tagname,initCoordinateX,endCoordinateX,initCoordinateY,endCoordinateY};
			return new MessageFormat(addPreDefinedRegionTagToImage).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @param tagname
	 * @return the deleteTagToImage
	 */
	public String getDeleteTagToImage(String id, String tagname) {
		if(!id.equals(null) && !tagname.equals(null)){
			Object[] params = {id,tagname};
			return new MessageFormat(deleteTagToImage).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param exifField
	 * @param exifValue
	 * @return the modifyImageExif
	 */
	public String getModifyImageExif(String id, String exifField, String exifValue) {
		if(!id.equals(null) && !exifField.equals(null) && !exifValue.equals(null)){
			Object[] params = {id,exifField,exifValue};
			return new MessageFormat(modifyImageExif).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param propertyField
	 * @param propertyValue
	 * @return the modifyImageProperties
	 */
	public String getModifyImageProperties(String id, String propertyField, String propertyValue) {
		if(!id.equals(null) && !propertyField.equals(null) && !propertyValue.equals(null)){
			Object[] params = {id,propertyField,propertyValue};
			return new MessageFormat(modifyImageProperties).format(params);
		}
		return null;
	}

	/**
	 * Getter
	 * @param id
	 * @param rankField
	 * @param rankValue
	 * @return the modifyImageRank
	 */
	public String getModifyImageRank(String id, String rankField, String rankValue) {
		if(!id.equals(null) && !rankField.equals(null) && !rankValue.equals(null)){
			Object[] params = {id,rankField,rankValue};
			return new MessageFormat(modifyImageRank).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param owner
	 * @param title
	 * @return the addBasicVideo
	 */
	public String getAddBasicVideo(String id, String owner, String title) {
		if(!id.equals(null) && !owner.equals(null) && !title.equals(null)){
			Object[] params = {id,owner,title};
			return new MessageFormat(addBasicVideo).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @return the deleteVideo
	 */
	public String getDeleteVideo(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(deleteVideo).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param fieldName
	 * @param fieldValue
	 * @return the modifyVideoField
	 */
	public String getModifyVideoField(String id, String fieldName, String fieldValue) {
		if(!id.equals(null) && !fieldName.equals(null) && !fieldValue.equals(null)){
			Object[] params = {id,fieldName,fieldValue};
			return new MessageFormat(modifyVideoField).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param fieldName
	 * @param fieldValue
	 * @return the modifyVideoRate
	 */
	public String getModifyVideoRate(String id, String fieldName, String fieldValue) {
		if(!id.equals(null) && !fieldName.equals(null) && !fieldValue.equals(null)){
			Object[] params = {id,fieldName,fieldValue};
			return new MessageFormat(modifyVideoRate).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param tagname
	 * @return the addFreeTagToVideo
	 */
	public String getAddFreeTagToVideo(String id, String tagname) {
		if(!id.equals(null) && !tagname.equals(null)){
			Object[] params = {id,tagname};
			return new MessageFormat(addFreeTagToVideo).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param taxonomy
	 * @param tagname
	 * @return the addPreDefinedTagToVideo
	 */
	public String getAddPreDefinedTagToVideo(String id, String taxonomy, String tagname) {
		if(!id.equals(null) && !taxonomy.equals(null) && !tagname.equals(null)){
			Object[] params = {id,taxonomy,tagname};
			return new MessageFormat(addPreDefinedTagToVideo).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param tagname
	 * @return the deleteTagToVideo
	 */
	public String getDeleteTagToVideo(String id, String tagname) {
		if(!id.equals(null) && !tagname.equals(null)){
			Object[] params = {id,tagname};
			return new MessageFormat(deleteTagToVideo).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @return the deleteNotice
	 */
	public String getDeleteNotice(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(deleteNotice).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param firstName
	 * @param lastName
	 * @param nickName
	 * @param userDirectory
	 * @param email
	 * @return the addUser
	 */
	public String getAddUser(String id, String firstName, String lastName,
			String nickName, String userDirectory, String email) {
		if(!id.equals(null) && !firstName.equals(null) && !lastName.equals(null) &&
				!nickName.equals(null) && !userDirectory.equals(null) && !email.equals(null)){
			Object[] params = {id,firstName,lastName,nickName,userDirectory,email};
			return new MessageFormat(addUser).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @return the deleteUser
	 */
	public String getDeleteUser(String id) {
		if(!id.equals(null)){
			Object[] params = {id};
			return new MessageFormat(deleteUser).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param fieldName
	 * @param fieldValue
	 * @return the modifyUserField
	 */
	public String getModifyUserField(String id, String fieldName, String fieldValue) {
		if(!id.equals(null) && !fieldName.equals(null) && !fieldValue.equals(null)){
			Object[] params = {id,fieldName,fieldValue};
			return new MessageFormat(modifyUserField).format(params);
		}
		return null;
	}

	/**
	 * Getter.
	 * @param id
	 * @param fieldName
	 * @param fieldValue
	 * @return the modifyUserName
	 */
	public String getModifyUserName(String id, String fieldName, String fieldValue) {
		if(!id.equals(null) && !fieldName.equals(null) && !fieldValue.equals(null)){
			Object[] params = {id,fieldName,fieldValue};
			return new MessageFormat(modifyUserName).format(params);
		}
		return null;
	}
    public String getImageIdFromURL(String URL) {
		if(!URL.equals(null)){
			Object[] params = {URL};
			return new MessageFormat(imageIdFromURL).format(params);
		}
		return null;
	}
    public String getVideoIdFromURL(String URL) {
		if(!URL.equals(null)){
			Object[] params = {URL};
            
			return new MessageFormat(videoIdFromURL).format(params);
		}
		return null;
	}
}
